<%@ page import="java.util.List" %>
<%@ page import="top.wuyang.study.javawebjdbc.workexam.TbExam" %>
<%@ page import="top.wuyang.study.javawebjdbc.workexam.TbExamDAO" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/5/30
  Time: 14:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>成绩表</title>
    <link href="../../lib/bootstarp.min.css" rel="stylesheet">
</head>
<body>

<h2>
    <a href="../../index.jsp">返回目录</a>
</h2>

<%
    List<TbExam> list = TbExamDAO.query();
%>

<div style="padding: 1rem">

    <%--  成绩表+添加成绩按钮  --%>
    <div style="display: flex; justify-content: space-around;">
        <div>
            <h2>考试成绩表</h2>
        </div>
        <div>
            <a class="btn btn-success" href="insert.jsp">添加成绩</a>
        </div>
    </div>

    <%--  表格  --%>
    <table class="table table-hover table-striped table-bordered">

        <thead>
        <tr class="text-bg-success">
            <th>编号</th>
            <th>考试科目</th>
            <th>考试学生</th>
            <th>考试成绩(总分为100)</th>
            <th>考试等级(共5级)</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <% for (TbExam tbExam : list) { %>
        <tr>
            <td><%=tbExam.getId()%></td>
            <td><%=tbExam.getSubject()%></td>
            <td><%=tbExam.getStudent()%></td>
            <td><%=tbExam.getScore()%></td>
            <td><%=tbExam.getLevel()%></td>
            <td>
                <a class="btn btn-sm btn-danger" href="delete.jsp?id=<%=tbExam.getId()%>">成绩作废</a>
            </td>
        </tr>
        <% } %>
        </tbody>

    </table>


</div>


<script src="../../lib/bootstarp.min.js"></script>
</body>
</html>
